﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SimpleCut.Data;
using Newtonsoft.Json;
using System.IO;
namespace SimpleCut.Config
{
    public class ConfigHelper
    {
        public string ConfigPath = @"c:\SimpleCut\SizeItems.txt";
        public void SaveConfig(SizeItems items)
        {
            var json = JsonConvert.SerializeObject(items);
            File.WriteAllText(ConfigPath, json);
        }

        public SizeItems ReadConfig()
        {
            var data = File.ReadAllText(ConfigPath);
            return JsonConvert.DeserializeObject<SizeItems>(data);
        }
    }
}
